module SimpleScopeTestHelper
  
  # Clear all scoping, everywhere, in the whole world
  def clear_all_scopes
    Object.subclasses_of(ActiveRecord::Base).each { |k| clear_scope_on(k) }
  end
  
  # Clear the scoping for classes individually. Just pass a series of constants
  def clear_scope_for(*classes)
    classes.each { |k| clear_scope_on(k) }
  end
  
  protected
  def clear_scope_on(klass)
    klass.send(:scoped_methods).clear if klass.respond_to?(:scoped_methods, true)
  end

end